curl --request PATCH \
--url https://firespark.cloud/api/storefront/v1/customers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "John Smith",
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"phone": "+593 99 123 4567",
"delivery_addresses": [
{
"alias": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"reference": "<string>",
"latitude": 0,
"longitude": 0,
"instructions": "<string>",
"preferred": false,
"metadata": {}
}
],
"billing_profiles": [
{
"alias": "<string>",
"legal_name": "<string>",
"address_line1": "<string>",
"tax_id": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"preferred": false,
"metadata": {}
}
],
"metadata": {},
"consent": {
"email": false,
"push_notifications": false,
"in_app_messages": false,
"phone_calls": false,
"sms": false,
"whatsapp": false
},
"devices": [
{
"id": "<string>",
"fcm_token": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
'import requests
url = "https://firespark.cloud/api/storefront/v1/customers/{id}"
payload = {
"name": "John Smith",
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"phone": "+593 99 123 4567",
"delivery_addresses": [
{
"alias": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"reference": "<string>",
"latitude": 0,
"longitude": 0,
"instructions": "<string>",
"preferred": False,
"metadata": {}
}
],
"billing_profiles": [
{
"alias": "<string>",
"legal_name": "<string>",
"address_line1": "<string>",
"tax_id": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"preferred": False,
"metadata": {}
}
],
"metadata": {},
"consent": {
"email": False,
"push_notifications": False,
"in_app_messages": False,
"phone_calls": False,
"sms": False,
"whatsapp": False
},
"devices": [
{
"id": "<string>",
"fcm_token": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'John Smith',
dob: '2023-11-07T05:31:56Z',
document_type: '<string>',
document_number: '<string>',
country: '<string>',
phone: '+593 99 123 4567',
delivery_addresses: [
{
alias: '<string>',
address_line1: '<string>',
address_line2: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>',
reference: '<string>',
latitude: 0,
longitude: 0,
instructions: '<string>',
preferred: false,
metadata: {}
}
],
billing_profiles: [
{
alias: '<string>',
legal_name: '<string>',
address_line1: '<string>',
tax_id: '<string>',
address_line2: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>',
preferred: false,
metadata: {}
}
],
metadata: {},
consent: {
email: false,
push_notifications: false,
in_app_messages: false,
phone_calls: false,
sms: false,
whatsapp: false
},
devices: [
{
id: '<string>',
fcm_token: '<string>',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z'
}
]
})
};
fetch('https://firespark.cloud/api/storefront/v1/customers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://firespark.cloud/api/storefront/v1/customers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'John Smith',
'dob' => '2023-11-07T05:31:56Z',
'document_type' => '<string>',
'document_number' => '<string>',
'country' => '<string>',
'phone' => '+593 99 123 4567',
'delivery_addresses' => [
[
'alias' => '<string>',
'address_line1' => '<string>',
'address_line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>',
'reference' => '<string>',
'latitude' => 0,
'longitude' => 0,
'instructions' => '<string>',
'preferred' => false,
'metadata' => [
]
]
],
'billing_profiles' => [
[
'alias' => '<string>',
'legal_name' => '<string>',
'address_line1' => '<string>',
'tax_id' => '<string>',
'address_line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>',
'preferred' => false,
'metadata' => [
]
]
],
'metadata' => [
],
'consent' => [
'email' => false,
'push_notifications' => false,
'in_app_messages' => false,
'phone_calls' => false,
'sms' => false,
'whatsapp' => false
],
'devices' => [
[
'id' => '<string>',
'fcm_token' => '<string>',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://firespark.cloud/api/storefront/v1/customers/{id}"
payload := strings.NewReader("{\n \"name\": \"John Smith\",\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"+593 99 123 4567\",\n \"delivery_addresses\": [\n {\n \"alias\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"reference\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"instructions\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"billing_profiles\": [\n {\n \"alias\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"tax_id\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"metadata\": {},\n \"consent\": {\n \"email\": false,\n \"push_notifications\": false,\n \"in_app_messages\": false,\n \"phone_calls\": false,\n \"sms\": false,\n \"whatsapp\": false\n },\n \"devices\": [\n {\n \"id\": \"<string>\",\n \"fcm_token\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://firespark.cloud/api/storefront/v1/customers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"John Smith\",\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"+593 99 123 4567\",\n \"delivery_addresses\": [\n {\n \"alias\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"reference\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"instructions\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"billing_profiles\": [\n {\n \"alias\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"tax_id\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"metadata\": {},\n \"consent\": {\n \"email\": false,\n \"push_notifications\": false,\n \"in_app_messages\": false,\n \"phone_calls\": false,\n \"sms\": false,\n \"whatsapp\": false\n },\n \"devices\": [\n {\n \"id\": \"<string>\",\n \"fcm_token\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://firespark.cloud/api/storefront/v1/customers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"John Smith\",\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"+593 99 123 4567\",\n \"delivery_addresses\": [\n {\n \"alias\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"reference\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"instructions\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"billing_profiles\": [\n {\n \"alias\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"tax_id\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"metadata\": {},\n \"consent\": {\n \"email\": false,\n \"push_notifications\": false,\n \"in_app_messages\": false,\n \"phone_calls\": false,\n \"sms\": false,\n \"whatsapp\": false\n },\n \"devices\": [\n {\n \"id\": \"<string>\",\n \"fcm_token\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "<string>",
"name": "John Smith",
"registration_date": "2023-11-07T05:31:56Z",
"is_anonymous": false,
"email": "jsmith@example.com",
"email_verified": false,
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"phone": "+593 99 123 4567",
"phone_verified": false,
"devices": [
{
"id": "<string>",
"fcm_token": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"delivery_addresses": [
{
"alias": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"reference": "<string>",
"latitude": 0,
"longitude": 0,
"instructions": "<string>",
"preferred": false,
"metadata": {}
}
],
"billing_profiles": [
{
"alias": "<string>",
"legal_name": "<string>",
"address_line1": "<string>",
"tax_id": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"preferred": false,
"metadata": {}
}
],
"consent": {
"email": false,
"push_notifications": false,
"in_app_messages": false,
"phone_calls": false,
"sms": false,
"whatsapp": false
},
"metadata": {}
}
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>",
"details": "<string>"
}Update customer
Update the authenticated customer’s profile, consent preferences, or push devices.
curl --request PATCH \
--url https://firespark.cloud/api/storefront/v1/customers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "John Smith",
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"phone": "+593 99 123 4567",
"delivery_addresses": [
{
"alias": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"reference": "<string>",
"latitude": 0,
"longitude": 0,
"instructions": "<string>",
"preferred": false,
"metadata": {}
}
],
"billing_profiles": [
{
"alias": "<string>",
"legal_name": "<string>",
"address_line1": "<string>",
"tax_id": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"preferred": false,
"metadata": {}
}
],
"metadata": {},
"consent": {
"email": false,
"push_notifications": false,
"in_app_messages": false,
"phone_calls": false,
"sms": false,
"whatsapp": false
},
"devices": [
{
"id": "<string>",
"fcm_token": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
'import requests
url = "https://firespark.cloud/api/storefront/v1/customers/{id}"
payload = {
"name": "John Smith",
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"phone": "+593 99 123 4567",
"delivery_addresses": [
{
"alias": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"reference": "<string>",
"latitude": 0,
"longitude": 0,
"instructions": "<string>",
"preferred": False,
"metadata": {}
}
],
"billing_profiles": [
{
"alias": "<string>",
"legal_name": "<string>",
"address_line1": "<string>",
"tax_id": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"preferred": False,
"metadata": {}
}
],
"metadata": {},
"consent": {
"email": False,
"push_notifications": False,
"in_app_messages": False,
"phone_calls": False,
"sms": False,
"whatsapp": False
},
"devices": [
{
"id": "<string>",
"fcm_token": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'John Smith',
dob: '2023-11-07T05:31:56Z',
document_type: '<string>',
document_number: '<string>',
country: '<string>',
phone: '+593 99 123 4567',
delivery_addresses: [
{
alias: '<string>',
address_line1: '<string>',
address_line2: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>',
reference: '<string>',
latitude: 0,
longitude: 0,
instructions: '<string>',
preferred: false,
metadata: {}
}
],
billing_profiles: [
{
alias: '<string>',
legal_name: '<string>',
address_line1: '<string>',
tax_id: '<string>',
address_line2: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>',
preferred: false,
metadata: {}
}
],
metadata: {},
consent: {
email: false,
push_notifications: false,
in_app_messages: false,
phone_calls: false,
sms: false,
whatsapp: false
},
devices: [
{
id: '<string>',
fcm_token: '<string>',
created_at: '2023-11-07T05:31:56Z',
updated_at: '2023-11-07T05:31:56Z'
}
]
})
};
fetch('https://firespark.cloud/api/storefront/v1/customers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://firespark.cloud/api/storefront/v1/customers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'John Smith',
'dob' => '2023-11-07T05:31:56Z',
'document_type' => '<string>',
'document_number' => '<string>',
'country' => '<string>',
'phone' => '+593 99 123 4567',
'delivery_addresses' => [
[
'alias' => '<string>',
'address_line1' => '<string>',
'address_line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>',
'reference' => '<string>',
'latitude' => 0,
'longitude' => 0,
'instructions' => '<string>',
'preferred' => false,
'metadata' => [
]
]
],
'billing_profiles' => [
[
'alias' => '<string>',
'legal_name' => '<string>',
'address_line1' => '<string>',
'tax_id' => '<string>',
'address_line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>',
'preferred' => false,
'metadata' => [
]
]
],
'metadata' => [
],
'consent' => [
'email' => false,
'push_notifications' => false,
'in_app_messages' => false,
'phone_calls' => false,
'sms' => false,
'whatsapp' => false
],
'devices' => [
[
'id' => '<string>',
'fcm_token' => '<string>',
'created_at' => '2023-11-07T05:31:56Z',
'updated_at' => '2023-11-07T05:31:56Z'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://firespark.cloud/api/storefront/v1/customers/{id}"
payload := strings.NewReader("{\n \"name\": \"John Smith\",\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"+593 99 123 4567\",\n \"delivery_addresses\": [\n {\n \"alias\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"reference\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"instructions\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"billing_profiles\": [\n {\n \"alias\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"tax_id\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"metadata\": {},\n \"consent\": {\n \"email\": false,\n \"push_notifications\": false,\n \"in_app_messages\": false,\n \"phone_calls\": false,\n \"sms\": false,\n \"whatsapp\": false\n },\n \"devices\": [\n {\n \"id\": \"<string>\",\n \"fcm_token\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://firespark.cloud/api/storefront/v1/customers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"John Smith\",\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"+593 99 123 4567\",\n \"delivery_addresses\": [\n {\n \"alias\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"reference\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"instructions\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"billing_profiles\": [\n {\n \"alias\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"tax_id\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"metadata\": {},\n \"consent\": {\n \"email\": false,\n \"push_notifications\": false,\n \"in_app_messages\": false,\n \"phone_calls\": false,\n \"sms\": false,\n \"whatsapp\": false\n },\n \"devices\": [\n {\n \"id\": \"<string>\",\n \"fcm_token\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://firespark.cloud/api/storefront/v1/customers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"John Smith\",\n \"dob\": \"2023-11-07T05:31:56Z\",\n \"document_type\": \"<string>\",\n \"document_number\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"+593 99 123 4567\",\n \"delivery_addresses\": [\n {\n \"alias\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"reference\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"instructions\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"billing_profiles\": [\n {\n \"alias\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"tax_id\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\",\n \"preferred\": false,\n \"metadata\": {}\n }\n ],\n \"metadata\": {},\n \"consent\": {\n \"email\": false,\n \"push_notifications\": false,\n \"in_app_messages\": false,\n \"phone_calls\": false,\n \"sms\": false,\n \"whatsapp\": false\n },\n \"devices\": [\n {\n \"id\": \"<string>\",\n \"fcm_token\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "<string>",
"name": "John Smith",
"registration_date": "2023-11-07T05:31:56Z",
"is_anonymous": false,
"email": "jsmith@example.com",
"email_verified": false,
"dob": "2023-11-07T05:31:56Z",
"document_type": "<string>",
"document_number": "<string>",
"country": "<string>",
"phone": "+593 99 123 4567",
"phone_verified": false,
"devices": [
{
"id": "<string>",
"fcm_token": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"delivery_addresses": [
{
"alias": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"reference": "<string>",
"latitude": 0,
"longitude": 0,
"instructions": "<string>",
"preferred": false,
"metadata": {}
}
],
"billing_profiles": [
{
"alias": "<string>",
"legal_name": "<string>",
"address_line1": "<string>",
"tax_id": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"preferred": false,
"metadata": {}
}
],
"consent": {
"email": false,
"push_notifications": false,
"in_app_messages": false,
"phone_calls": false,
"sms": false,
"whatsapp": false
},
"metadata": {}
}
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>",
"details": "<string>"
}id. Send only the fields you want to change. Omitted top-level fields keep their current values.
Use this endpoint to update profile fields, channel consent, and the push device list. To read the full customer object, use get customer.
Path parameters
| Parameter | Required | Description |
|---|---|---|
id | Yes | External customer identifier. Must match the token’s customer id. |
Request body
| Field | Required | Description |
|---|---|---|
name | No | Full name. |
gender | No | MALE, FEMALE, or OTHER. |
dob | No | Date of birth (ISO 8601 with offset). Cannot be changed after it is set. |
document_type | No | Government ID type. |
document_number | No | Government ID number. |
country | No | Customer country. |
phone | No | Phone number in international format. |
delivery_addresses | No | Up to 10 saved delivery addresses. Replaces the existing list when provided. At most one may have preferred: true. |
billing_profiles | No | Up to 10 billing profiles. Replaces the existing list when provided. Each profile requires type (INDIVIDUAL or BUSINESS). At most one may have preferred: true. |
consent | No | Channel consent preferences. Send only the flags you want to change; omitted flags keep their current values. |
devices | No | Full list of push devices (max 10). Replaces the existing list when provided. To unregister a device, omit it from the array. |
metadata | No | Custom key-value metadata. Must serialize to 1MB or less. |
delivery_addresses, billing_profiles, devices, and consent objects use the same shapes as get customer.
Consent
| Field | Type | Description |
|---|---|---|
email | boolean | Email marketing |
push_notifications | boolean | Push notifications |
in_app_messages | boolean | In-app messages |
phone_calls | boolean | Phone calls |
sms | boolean | SMS messages |
whatsapp | boolean | WhatsApp messages |
Device
| Field | Required | Type | Description |
|---|---|---|---|
id | Yes | string | External device identifier. |
os | Yes | string | IOS, ANDROID, or WEB. |
fcm_token | Yes | string | Firebase Cloud Messaging token. |
created_at | Yes | datetime | When the device was registered. |
updated_at | Yes | datetime | When the device was last updated. |
Request
curl -X PATCH "https://firespark.cloud/api/storefront/v1/customers/auth0|abc123" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phone": "+593991234567",
"consent": {
"email": true,
"push_notifications": true,
"sms": true
},
"devices": [
{
"id": "iphone-15-pro",
"os": "IOS",
"fcm_token": "fcm-token-abc123",
"created_at": "2026-01-10T08:00:00Z",
"updated_at": "2026-03-01T12:00:00Z"
}
]
}'
Response
Returns the updated customer object indata, using the same shape as get customer.
Error responses
| Status | Description |
|---|---|
400 | Invalid request body. |
401 | Missing or invalid access token. |
403 | The id does not match the token’s customer id. |
404 | No customer found with the given id. |
422 | Cannot update date of birth or gender if already set, or invalid devices payload. |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The customer unique identifier in your system
Body
Partial customer update. Omit fields you do not want to change. When devices is provided, it replaces the full device list. When consent is provided, omitted consent flags keep their current values.
The full name of the customer
"John Smith"
The gender of the customer
MALE, FEMALE, OTHER The date of birth of the customer
The document type of the customer
The document number of the customer
50The country of the customer
100The customer's phone number in international format
"+593 99 123 4567"
10Show child attributes
Show child attributes
10Show child attributes
Show child attributes
Custom metadata for the customer
Channel consent preferences. Send only the flags you want to change.
Show child attributes
Show child attributes
Full list of push devices for the customer. Replaces the existing list when provided. To unregister a device, omit it from this array. Maximum 10 devices.
10Show child attributes
Show child attributes
Response
Customer updated
Customer profile returned by Storefront API endpoints. Omits internal fields such as birthday.
Show child attributes
Show child attributes